<?php
namespace App\Http\Controllers\Wxxcx;

use App\Services\Wxxcx\AdService;
use Illuminate\Http\Request;

class AdController extends BaseController
{
    /**
     * 服务
     */

    public function __construct(AdService $service)
    {
        $this->db = $service;
    }

    /**
     * 列表
     */
    public function getList(Request $request)
    {
        $pages['start'] = $request->post('start', 1);
        $pages['limit'] = $request->post('limit', 10);
        $pas['uid'] = $request->post('uid', 0);
        $res = $this->db->getList($pages, $pas);
        if ($res['code'] < 0) {
            return $this->toJson(-2, $res['msg']);
        }
        return $this->toJson(0, '', $res['data'], $res['total']);
    }
}